home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 673 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. From: thp@cs.ucr.edu (Tom Payne)
  2. Message-ID: <4hpseb$ld6@galaxy.ucr.edu>
  3. X-Original-Date: 8 Mar 1996 17:57:31 GMT
  4. Path: in2.uu.net!bounce-back
  5. Date: 09 Mar 96 04:37:06 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: 'const' in header files
  9. Organization: University of California, Riverside
  10. References: <AD5A0C5196681CA0D@sleipner.nts.mh.se>
  11. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMUELQuEDnX0m9pzZAQFd/AGAmnmmpsNO0fSZVDUy4bp+O4cslbweEkOr
  14.     4nwfEAIX7qUwP6hC5voahp6JUTfZj7Uh
  15.     =c4c/
  16.  
  17. Lars Farm (lars.farm@nts.mh.se) wrote:
  18. : Experts explained that this is as it should be for const float, but not for
  19. : const int (I know that the std does not talk about warnings). The point is:
  20. : The experts seems to find some kind of conceptual difference between named
  21. : constant floats and named constant ints, such that declaring const int K =
  22. : L; in a header is considered good practice but const float X = Y; in a
  23. : header is not and justifies a warning. I don't think there should be any
  24. : such difference.
  25.  
  26. In fact, there is no such difference, as I understand it, in the way the
  27. standard treats float and int in this regard.
  28.  
  29. Unused-variable warnings (a quality-of-implementation matter) are often
  30. less than helpful, e.g., I get such a warning every time I acquire mutual
  31. exclusion by creating an object whose constructor acquires the lock and
  32. whose destructor releases it, since the object is not accessed elsewhere.
  33.  
  34. Tom Payne (thp@cs.ucr.edu)
  35. ---
  36. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  37. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  38. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  39. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  40. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  41.